package cn.eonshine.cuba.inf.modular.biz.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import lombok.Data;

/**
 * <p>
 * Inventory data（每日库存表）
 * </p>
 *
 * @author Alan
 * @since 2018-07-28
 */
@TableName("inf_inventory_data")
@Data
public class InventoryData extends Model<InventoryData> {

    private static final long serialVersionUID = 1L;

    /**
     * 
     * lsms主键
     */
    @TableField(exist = false)
    private String id;
    /**
     * organization ID
     */
    @TableId
    @TableField("org_id")
    private String orgId;
    /**
     * organization Type: depot、refinery、oilfield、oil station、customer组织类型：油库、炼厂、油田、加油站、大客户
     */
    @TableField("org_type")
    private String orgType;
    /**
     * tank primary key 油罐
     */
    @TableId
    @TableField("oilcan_id")
    private String oilcanId;
    /**
     * oil primary key  油品
     */
    @TableId
    @TableField("oil_id")
    private String oilId;
    /**
     * quantity（m3）数量
     */
    private BigDecimal quantity;
    /**
     * report date （day）
     */
    @TableId
    @TableField("rpt_date")
    private Date rptDate;
    /**
     * Create time
              创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * Remarks information
              备注信息
     */
    private String remarks;
    /**
     * Empty Tank Value（m3）空容值
     */
    @TableField("empty_tank_quantity")
    private BigDecimal emptyTankQuantity;
    /**
     * Third party value（m3）第三方罐容值
     */
    @TableField("third_party_quantity")
    private BigDecimal thirdPartyQuantity;


    /**
     * 数据更新状态： 1-古巴初始插入，0-LSMS已经拿到数据
     */
    @TableField("lsms_update")
    private Integer lsmsUpdate;
    
    /**
     * 数据接口时间
     */
    @TableField("data_input_datetime")
    private Date dataInputDatetime;


    @Override
    protected Serializable pkVal() {
        return this.orgId+"_"+this.oilcanId+"_"+this.oilId+"_"+this.rptDate;
    }

    @TableField(exist = false)
    private String dmzOrgId;
    
    @TableField(exist = false)
    private String dmzOilId;
    
    @TableField(exist = false)
    private String dmzOilCanId;

}
